﻿namespace EventbriteApi.Model
{
    using System.Web.WebPages;

    public class Venue
    {
        [System.Xml.Serialization.XmlElement("id")]
        public long Id { get; set; }

        [System.Xml.Serialization.XmlElement("name")]
        public string Name { get; set; }

        [System.Xml.Serialization.XmlElement("address")]
        public string Address { get; set; }

        [System.Xml.Serialization.XmlElement("address_2")]
        public string Address2 { get; set; }

        [System.Xml.Serialization.XmlElement("city")]
        public string City { get; set; }

        [System.Xml.Serialization.XmlElement("region")]
        public string Region { get; set; }

        [System.Xml.Serialization.XmlElement("postal_code")]
        public string PostalCode { get; set; }

        [System.Xml.Serialization.XmlElement("country")]
        public string Country { get; set; }

        [System.Xml.Serialization.XmlElement("country_code")]
        public string CountryCode { get; set; }

        [System.Xml.Serialization.XmlElement("longitude")]
        public float Longitude { get; set; }

        [System.Xml.Serialization.XmlElement("latitude")]
        public float Latitude { get; set; }

        [System.Xml.Serialization.XmlElement("Lat-Long")]
        public string LatLong { get; set; }

        public override string ToString()
        {
            var result = this.Name ?? "";

            if (!result.IsEmpty())
            {
                result += ", " + this.City ?? "";
            }
            else
            {
                result += this.City ?? "";
            }

            return result;
        }
    }
}
